From e4175071a0d544e3cf6737c568e1ab79ce3ccf2b Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 3 Aug 2009 19:36:11 +0000 Subject: [PATCH] Tweak Earth 5's realtime KML to include end of time window. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@3740 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/kml.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gpsbabel/kml.c b/gpsbabel/kml.c index 29e809ff0..c35a36756 100644 --- a/gpsbabel/kml.c +++ b/gpsbabel/kml.c @@ -1109,7 +1109,16 @@ void kml_write_AbstractView(void) { } if (kml_time_max) { char time_string[64]; - xml_fill_in_time(time_string, kml_time_max, 0, XML_LONG_TIME); + time_t time_max; + // In realtime tracking mode, we fudge the end time by a few minutes + // to ensure that the freshest data (our current location) is contained + // within the timespan. Earth's time may not match the GPS because + // we may not be running NTP, plus it's polling a file (sigh) to read + // the network position. So we shove the end of the timespan out to + // ensure the right edge of that time slider includes us. + // + time_max = realtime_positioning ? kml_time_max + 600 : kml_time_max; + xml_fill_in_time(time_string, time_max, 0, XML_LONG_TIME); if (time_string[0]) { kml_write_xml(0, "%s\n", time_string); } -- 2.30.2